package thread;

public class Demo15 {
    public static void main(String[] args) throws InterruptedException {
        Thread mainThread = Thread.currentThread();
        Thread t1 = new Thread(() -> {
            while (true) {
                try {
                    System.out.println("mainThread state:" + mainThread.getState());
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        System.out.println(t1.getState());
        t1.start();
        t1.join();


    }
}
